<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui"
	xmlns:f="http://java.sun.com/jsf/core">
<h:head>
	<title><ui:insert name="title" /></title>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<h:outputStylesheet library="css" name="bootstrap.css"></h:outputStylesheet>
	<h:outputStylesheet library="css" name="estilo.css"></h:outputStylesheet>
</h:head>
<h:body>
	<div class="page-container">
		<h:panelGroup>
			<h:form prependId="false">
				<p:menubar autoDisplay="false" id="meuMenu">
					<p:menuitem value="Home" action="#{editalController.retornaHome()}"
						update="@all" icon="ui-icon-home" />
					<p:submenu label="Administração" icon="ui-icon-gear"
						rendered="#{loginController.usuario.perfil == 1}">
						<p:submenu label="Fornecedor" icon="ui-icon-newwin">
							<p:menuitem value="Novo" icon="ui-icon-plus"
								url="/pages/user/fornecedor.xhtml" />
							<p:menuitem value="Listar"
								url="/pages/user/listarfornecedores.xhtml"
								icon="ui-icon-calculator" />
						</p:submenu>
						<p:submenu label="Edital" icon="ui-icon-newwin">
							<p:menuitem value="Novo" url="/pages/edital/novo.xhtml"
								icon="ui-icon-plus" />
							<p:menuitem value="Listar" url="/pages/edital/listaredital.xhtml"
								icon="ui-icon-calculator" />
						</p:submenu>
						<p:submenu label="Produto/Serviço" icon="ui-icon-newwin">
							<p:menuitem value="Novo" url="/pages/produto/novo.xhtml"
								icon="ui-icon-plus" update="messages" ajax="false" />
							<p:menuitem value="Listar"
								url="/pages/produto/listarproduto.xhtml"
								icon="ui-icon-calculator" />
						</p:submenu>
					</p:submenu>
					<p:submenu label="Cadastrar" icon="ui-icon-gear"
						rendered="#{loginController.logado eq false}">
						<p:submenu label="Fornecedor" icon="ui-icon-newwin">
							<p:menuitem value="Novo" icon="ui-icon-plus"
								url="/pages/user/fornecedor.xhtml" />

						</p:submenu>
					</p:submenu>
					<p:submenu label="Editar" icon="ui-icon-gear"
						rendered="#{loginController.usuario.perfil == 2}">
						<p:submenu label="Fornecedor" icon="ui-icon-newwin">
							<p:menuitem value="Meu Usuário" icon="ui-icon-plus"
								url="/pages/user/editarfornecedor.xhtml" />

						</p:submenu>
					</p:submenu>
					<p:menuitem value="Quem Somos" url="/" icon="ui-icon-person" />
					<p:submenu label="Ajuda" icon="ui-icon-help">
						<p:menuitem value="Contents" url="#" />
						<p:submenu label="Search" icon="ui-icon-search">
							<p:submenu label="Text">
								<p:menuitem value="Workspace" url="#" />
							</p:submenu>
							<p:menuitem value="File" url="#" />
						</p:submenu>
					</p:submenu>
					<f:facet name="options">
						<p:inputText id="usuario" style="margin-right:10px; width:100px"
							label="Usuario" value="#{loginController.usuario.usuario}"
							rendered="#{loginController.logado == false}" />
						<p:watermark for="usuario" value="Login"
							rendered="#{loginController.logado == false}" />
						<p:inputText id="senha" type="password"
							style="margin-right:10px; width:100px" label="Senha"
							value="#{loginController.usuario.senha}"
							rendered="#{loginController.logado == false}" />
						<p:watermark for="senha" value="Senha"
							rendered="#{loginController.logado == false}" />

						<h:outputText
							style="margin-right:10px; width:100px; font-size:16px"
							value="#{loginController.usuario.nome}"
							rendered="#{loginController.logado == true}" />

						<p:commandButton height="15px" value="Login"
							icon="ui-icon-arrowstop-1-s"
							actionListener="#{loginController.login}"
							action="#{loginController.logar}"
							rendered="#{loginController.logado == false}"
							update="meuMenu,growl" id="btnLogin"/>
						<p:growl id="growl" for="btnLogin"/>
						<p:commandButton height="15px" value="Logout"
							icon="ui-icon-arrowstop-1-n" action="#{loginController.logout}"
							rendered="#{loginController.logado == true}" update="meuMenu"
							ajax="false" />
					</f:facet>
				</p:menubar>
			</h:form>
		</h:panelGroup>
		<h:panelGroup>
			<div style="display: table-header-group;">
				<h:form prependId="false">
					<div style="float: left; padding-left: 30px">
						<h:outputLink value="#{request.contextPath}/">
							<p:graphicImage id="logo" library="images" name="logo.png"
								alt="#logo" title="BidMan Logo" />
						</h:outputLink>
					</div>
					<ui:insert name="pesquisa" />
				</h:form>
			</div>
		</h:panelGroup>

		<div class="insert" id="edit">
			<h:panelGroup id="editais">
				<p:panel styleClass="content"
					style="border-width:5px; width: 1000px; margin-left: auto; margin-right: auto">
					<ui:insert name="conteudo" />
				</p:panel>
				<p:panel styleClass="footer">
				© 2013 BidMan.com. All rights reserved.
				</p:panel>
			</h:panelGroup>
		</div>
	</div>
	<script>
		PrimeFaces.locales['pt_BR'] = {
			closeText : 'Fechar',
			prevText : 'Anterior',
			nextText : 'Próximo',
			currentText : 'Agora',
			monthNames : [ 'Janeiro', 'Fevereiro', 'Março', 'Abril', 'Maio',
					'Junho', 'Julho', 'Agosto', 'Setembro', 'Outubro',
					'Novembro', 'Dezembro' ],
			monthNamesShort : [ 'Jan', 'Fev', 'Mar', 'Abr', 'Mai', 'Jun',
					'Jul', 'Ago', 'Set', 'Out', 'Nov', 'Des' ],
			dayNames : [ 'Domingo', 'Segunda', 'Terça', 'Quarta', 'Quinta',
					'Sexta', 'Sábado' ],
			dayNamesShort : [ 'Dom', 'Seg', 'Ter', 'Qua', 'Qui', 'Sex', 'Sáb' ],
			dayNamesMin : [ 'D', 'S', 'T', 'Q', 'Q', 'S', 'S' ],
			weekHeader : 'Semana',
			firstDay : 1,
			isRTL : false,
			showMonthAfterYear : false,
			yearSuffix : '',
			timeOnlyTitle : 'Só Horas',
			timeText : 'Tempo',
			hourText : 'Hora',
			minuteText : 'Minuto',
			secondText : 'Segundo',
			ampm : false,
			month : 'Mês',
			week : 'Semana',
			day : 'Dia',
			allDayText : 'Todo Dia'
		};
	</script>
</h:body>
</html>